/*
 * @Descripttion: 
 * @version: 
 * @Author: TT
 * @Date: 2023-10-21 16:47:24
 * @LastEditors: TT
 * @LastEditTime: 2023-10-28 15:25:47
 */
import 'package:hzy_normal_network/hzy_normal_network.dart';

class TuchongHttpTransformer extends HzyNormalTransFormer {
  @override
  HzyNormalResponse parse(Response response) {
    var json = response.data as Map<String, dynamic>?;
    if (json == null) {
      return HzyNormalResponse.fail(
        data: json,
        errorMsg: '请求的数据为空',
        errorCode: -1,
      );
    }
    var status = json["result"];
    if (status == "SUCCESS") {
      return HzyNormalResponse.success(
        netData: json["feedList"],
        response: json,
        reqMsg: json["message"],
      );
    } else {
      return HzyNormalResponse.fail(
        data: json,
        errorMsg: '请求的数据为空',
        errorCode: -1,
      );
    }
  }
}
